package com.example.demorabbitmq;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class DemoRabbitmqApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(DemoRabbitmqApplication.class, args);
        MqService mq = run.getBean(MqService.class);
        for (int i = 0; i < 10; i++) {
            String message = "demo send:" + i;
            mq.send(new MessageVO(message,1));
        }

    }

}
